package com.itheima.reggie.mapper;

import com.itheima.reggie.entity.SetmealDish;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface SetmealDishMapper {
    @Insert("insert into setmeal_dish (`setmeal_id`, `dish_id`, `name`, `price`, `copies`, `create_time`, `update_time`, `create_user`, `update_user`) values (#{setmealId},#{dishId},#{name},#{price},#{copies},#{createTime},#{updateTime},#{createUser},#{updateUser})")
    void insert(SetmealDish setmealDish);

    @Delete("delete from setmeal_dish where setmeal_id = #{id}")
    void deleteBySetmealId(String id);

    @Select("select * from setmeal_dish where setmeal_id = #{id}")
    List<SetmealDish> selectBySetmealId(String id);
}
